package com.bitters.ctrl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.bitters.domain.ConfigBean;
import com.bitters.domain.Department;
import com.bitters.domain.UserVo;

@RestController
public class MonkController {

	@Autowired
	ConfigBean configBean;
	@Autowired
	UserVo userVo;
	@Autowired
	Department department;

	@RequestMapping("config")
	public String hell() {
		return "配置文件注入对象成功：name=" + configBean.getName() + "☺☺☺☺☺☺age=" + configBean.getAge();
	}

	@RequestMapping("getUser")
	public String getUser() {
		return "配置文件注入对象成功：User=" + userVo.getUser() + "☺☺☺☺☺☺passwd=" + userVo.getUser();
	}

	/**
	 * 读取新的配置文件monk.properties
	 * 
	 * @return
	 */
	@RequestMapping("dept")
	public String dept() {
		return "读取新的配置文件monk.properties注入对象成功：dept=" + department.getName() + "☺☺☺☺☺☺ code=" + department.getCode();
	}
}
